home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / include / dvp.h < prev    next >
C/C++ Source or Header  |  2001-10-16  |  33KB  |  967 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:    dvp.h
  6.  *  Content:    DirectDrawVideoPort include file
  7.  *
  8.  ***************************************************************************/
  9.  
  10. #ifndef __DVP_INCLUDED__
  11. #define __DVP_INCLUDED__
  12.  
  13. /*
  14.  * GUIDS used by DirectDrawVideoPort objects
  15.  */
  16. #if defined( _WIN32 ) && (!defined( _NO_COM ) || defined( DEFINE_GUID ))
  17. DEFINE_GUID( IID_IDDVideoPortContainer,        0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  18. DEFINE_GUID( IID_IDirectDrawVideoPort,        0xB36D93E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  19. DEFINE_GUID( IID_IDirectDrawVideoPortNotify,    0xA655FB94,0x0589,0x4E57,0xB3,0x33,0x56,0x7A,0x89,0x46,0x8C,0x88);
  20.  
  21.  
  22.  
  23. DEFINE_GUID( DDVPTYPE_E_HREFH_VREFH, 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  24. DEFINE_GUID( DDVPTYPE_E_HREFH_VREFL, 0x92783220L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  25. DEFINE_GUID( DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  26. DEFINE_GUID( DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  27. DEFINE_GUID( DDVPTYPE_CCIR656,         0xFCA326A0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  28. DEFINE_GUID( DDVPTYPE_BROOKTREE,     0x1352A560L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  29. DEFINE_GUID( DDVPTYPE_PHILIPS,         0x332CF160L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  30. #endif
  31.  
  32. #ifndef GUID_DEFS_ONLY
  33.  
  34. #if defined( _WIN32 )  && !defined( _NO_COM )
  35. #define COM_NO_WINDOWS_H
  36. #include <objbase.h>
  37. #else
  38. #define IUnknown        void
  39. #endif
  40.  
  41. /*
  42.  * These definitions are required to allow polymorphic structure members (i.e. those
  43.  * that are referred to both as DWORDs and as pointers) to resolve into a type
  44.  * of correct size to hold the largest of those two types (i.e. pointer) on 64 bit
  45.  * systems. For 32 bit environments, ULONG_PTR resolves to a DWORD.
  46.  */
  47. #ifndef MAXULONG_PTR
  48. #define ULONG_PTR    DWORD
  49. #endif //MAXULONG_PTR
  50.  
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54.  
  55. /*============================================================================
  56.  *
  57.  * DirectDraw Structures
  58.  *
  59.  * Various structures used to invoke DirectDraw.
  60.  *
  61.  *==========================================================================*/
  62.  
  63. struct IDirectDraw;
  64. struct IDirectDrawSurface;
  65. struct IDirectDrawPalette;
  66. struct IDirectDrawClipper;
  67.  
  68. typedef struct IDDVideoPortContainer            FAR *LPDDVIDEOPORTCONTAINER;
  69. typedef struct IDirectDrawVideoPort             FAR *LPDIRECTDRAWVIDEOPORT;
  70. typedef struct IDirectDrawVideoPortNotify       FAR *LPDIRECTDRAWVIDEOPORTNOTIFY;
  71.  
  72. typedef struct _DDVIDEOPORTCONNECT              FAR *LPDDVIDEOPORTCONNECT;
  73. typedef struct _DDVIDEOPORTCAPS                 FAR *LPDDVIDEOPORTCAPS;
  74. typedef struct _DDVIDEOPORTDESC                 FAR *LPDDVIDEOPORTDESC;
  75. typedef struct _DDVIDEOPORTINFO                 FAR *LPDDVIDEOPORTINFO;
  76. typedef struct _DDVIDEOPORTBANDWIDTH            FAR *LPDDVIDEOPORTBANDWIDTH;
  77. typedef struct _DDVIDEOPORTSTATUS               FAR *LPDDVIDEOPORTSTATUS;
  78. typedef struct _DDVIDEOPORTNOTIFY               FAR *LPDDVIDEOPORTNOTIFY;
  79.  
  80. typedef struct IDDVideoPortContainerVtbl        DDVIDEOPORTCONTAINERCALLBACKS;
  81. typedef struct IDirectDrawVideoPortVtbl         DIRECTDRAWVIDEOPORTCALLBACKS;
  82. typedef struct IDirectDrawVideoPortNotifyVtbl   DIRECTDRAWVIDEOPORTNOTIFYCALLBACKS;
  83.  
  84.  
  85. /*
  86.  * API's
  87.  */
  88. typedef HRESULT (FAR PASCAL * LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID);
  89.  
  90.  
  91. /*
  92.  * INTERACES FOLLOW:
  93.  *    IDirectDrawVideoPort
  94.  *    IVideoPort
  95.  */
  96.  
  97. /*
  98.  * IDirectDrawVideoPortContainer
  99.  */
  100. #if defined( _WIN32 ) && !defined( _NO_COM )
  101. #undef INTERFACE
  102. #define INTERFACE IDDVideoPortContainer
  103. DECLARE_INTERFACE_( IDDVideoPortContainer, IUnknown )
  104. {
  105.     /*** IUnknown methods ***/
  106.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  107.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  108.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  109.     /*** IDirectDrawVideoPort methods ***/
  110.     STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT FAR *, IUnknown FAR *) PURE;
  111.     STDMETHOD(EnumVideoPorts)(THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID,LPDDENUMVIDEOCALLBACK ) PURE;
  112.     STDMETHOD(GetVideoPortConnectInfo)(THIS_ DWORD, LPDWORD, LPDDVIDEOPORTCONNECT ) PURE;
  113.     STDMETHOD(QueryVideoPortStatus)(THIS_ DWORD, LPDDVIDEOPORTSTATUS ) PURE;
  114. };
  115.  
  116. #if !defined(__cplusplus) || defined(CINTERFACE)
  117. #define IVideoPortContainer_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  118. #define IVideoPortContainer_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  119. #define IVideoPortContainer_Release(p)                      (p)->lpVtbl->Release(p)
  120. #define IVideoPortContainer_CreateVideoPort(p, a, b, c, d)  (p)->lpVtbl->CreateVideoPort(p, a, b, c, d)
  121. #define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d)   (p)->lpVtbl->EnumVideoPorts(p, a, b, c, d)
  122. #define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->lpVtbl->GetVideoPortConnectInfo(p, a, b, c)
  123. #define IVideoPortContainer_QueryVideoPortStatus(p, a, b)   (p)->lpVtbl->QueryVideoPortStatus(p, a, b)
  124. #else
  125. #define IVideoPortContainer_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  126. #define IVideoPortContainer_AddRef(p)                       (p)->AddRef()
  127. #define IVideoPortContainer_Release(p)                      (p)->Release()
  128. #define IVideoPortContainer_CreateVideoPort(p, a, b, c, d)  (p)->CreateVideoPort(a, b, c, d)
  129. #define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d)   (p)->EnumVideoPorts(a, b, c, d)
  130. #define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->GetVideoPortConnectInfo(a, b, c)
  131. #define IVideoPortContainer_QueryVideoPortStatus(p, a, b)   (p)->QueryVideoPortStatus(a, b)
  132. #endif
  133.  
  134. #endif
  135.  
  136.  
  137. /*
  138.  * IDirectDrawVideoPort
  139.  */
  140. #if defined( _WIN32 ) && !defined( _NO_COM )
  141. #undef INTERFACE
  142. #define INTERFACE IDirectDrawVideoPort
  143. DECLARE_INTERFACE_( IDirectDrawVideoPort, IUnknown )
  144. {
  145.     /*** IUnknown methods ***/
  146.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  147.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  148.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  149.     /*** IVideoPort methods ***/
  150.     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
  151.     STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE;
  152.     STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
  153.     STDMETHOD(GetInputFormats)(THIS_ LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
  154.     STDMETHOD(GetOutputFormats)(THIS_ LPDDPIXELFORMAT, LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
  155.     STDMETHOD(GetFieldPolarity)(THIS_ LPBOOL) PURE;
  156.     STDMETHOD(GetVideoLine)(THIS_ LPDWORD) PURE;
  157.     STDMETHOD(GetVideoSignalStatus)(THIS_ LPDWORD) PURE;
  158.     STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
  159.     STDMETHOD(SetTargetSurface)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
  160.     STDMETHOD(StartVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
  161.     STDMETHOD(StopVideo)(THIS) PURE;
  162.     STDMETHOD(UpdateVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
  163.     STDMETHOD(WaitForSync)(THIS_ DWORD, DWORD, DWORD) PURE;
  164. };
  165.  
  166. #if !defined(__cplusplus) || defined(CINTERFACE)
  167. #define IVideoPort_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
  168. #define IVideoPort_AddRef(p)                    (p)->lpVtbl->AddRef(p)
  169. #define IVideoPort_Release(p)                   (p)->lpVtbl->Release(p)
  170. #define IVideoPort_SetTargetSurface(p,a,b)    (p)->lpVtbl->SetTargetSurface(p,a,b)
  171. #define IVideoPort_Flip(p,a,b)            (p)->lpVtbl->Flip(p,a,b)
  172. #define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->lpVtbl->GetBandwidthInfo(p,a,b,c,d,e)
  173. #define IVideoPort_GetColorControls(p,a)     (p)->lpVtbl->GetColorControls(p,a)
  174. #define IVideoPort_GetInputFormats(p,a,b,c)    (p)->lpVtbl->GetInputFormats(p,a,b,c)
  175. #define IVideoPort_GetOutputFormats(p,a,b,c,d)    (p)->lpVtbl->GetOutputFormats(p,a,b,c,d)
  176. #define IVideoPort_GetFieldPolarity(p,a)    (p)->lpVtbl->GetFieldPolarity(p,a)
  177. #define IVideoPort_GetVideoLine(p,a)        (p)->lpVtbl->GetVideoLine(p,a)
  178. #define IVideoPort_GetVideoSignalStatus(p,a)    (p)->lpVtbl->GetVideoSignalStatus(p,a)
  179. #define IVideoPort_SetColorControls(p,a)    (p)->lpVtbl->SetColorControls(p,a)
  180. #define IVideoPort_StartVideo(p,a)        (p)->lpVtbl->StartVideo(p,a)
  181. #define IVideoPort_StopVideo(p)            (p)->lpVtbl->StopVideo(p)
  182. #define IVideoPort_UpdateVideo(p,a)        (p)->lpVtbl->UpdateVideo(p,a)
  183. #define IVideoPort_WaitForSync(p,a,b,c)        (p)->lpVtbl->WaitForSync(p,a,b,c)
  184. #else
  185. #define IVideoPort_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
  186. #define IVideoPort_AddRef(p)                    (p)->AddRef()
  187. #define IVideoPort_Release(p)                   (p)->Release()
  188. #define IVideoPort_SetTargetSurface(p,a,b)    (p)->SetTargetSurface(a,b)
  189. #define IVideoPort_Flip(p,a,b)            (p)->Flip(a,b)
  190. #define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->GetBandwidthInfo(a,b,c,d,e)
  191. #define IVideoPort_GetColorControls(p,a)     (p)->GetColorControls(a)
  192. #define IVideoPort_GetInputFormats(p,a,b,c)    (p)->GetInputFormats(a,b,c)
  193. #define IVideoPort_GetOutputFormats(p,a,b,c,d)    (p)->GetOutputFormats(a,b,c,d)
  194. #define IVideoPort_GetFieldPolarity(p,a)    (p)->GetFieldPolarity(a)
  195. #define IVideoPort_GetVideoLine(p,a)        (p)->GetVideoLine(a)
  196. #define IVideoPort_GetVideoSignalStatus(p,a)    (p)->GetVideoSignalStatus(a)
  197. #define IVideoPort_SetColorControls(p,a)    (p)->SetColorControls(a)
  198. #define IVideoPort_StartVideo(p,a)        (p)->StartVideo(a)
  199. #define IVideoPort_StopVideo(p)            (p)->StopVideo()
  200. #define IVideoPort_UpdateVideo(p,a)        (p)->UpdateVideo(a)
  201. #define IVideoPort_WaitForSync(p,a,b,c)        (p)->WaitForSync(a,b,c)
  202. #endif
  203.  
  204. #endif
  205.  
  206. /*
  207.  * IDirectDrawVideoPort
  208.  */
  209. #if defined( _WIN32 ) && !defined( _NO_COM )
  210. #undef INTERFACE
  211. #define INTERFACE IDirectDrawVideoPortNotify
  212. DECLARE_INTERFACE_( IDirectDrawVideoPortNotify, IUnknown )
  213. {
  214.     /*** IUnknown methods ***/
  215.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  216.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  217.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  218.     /*** IVideoPort methods ***/
  219.     STDMETHOD(AcquireNotification)(THIS_ HANDLE *, LPDDVIDEOPORTNOTIFY) PURE;
  220.     STDMETHOD(ReleaseNotification)(THIS_ HANDLE) PURE;
  221. };
  222.  
  223. #if !defined(__cplusplus) || defined(CINTERFACE)
  224. #define IVideoPortNotify_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
  225. #define IVideoPortNotify_AddRef(p)                  (p)->lpVtbl->AddRef(p)
  226. #define IVideoPortNotify_Release(p)                 (p)->lpVtbl->Release(p)
  227. #define IVideoPortNotify_AcquireNotification(p,a,b) (p)->lpVtbl->AcquireNotification(p,a,b)
  228. #define IVideoPortNotify_ReleaseNotification(p,a)   (p)->lpVtbl->ReleaseNotification(p,a)
  229. #else
  230. #define IVideoPortNotify_QueryInterface(p,a,b)      (p)->QueryInterface(a,b)
  231. #define IVideoPortNotify_AddRef(p)                  (p)->AddRef()
  232. #define IVideoPortNotify_Release(p)                 (p)->Release()
  233. #define IVideoPortNotify_AcquireNotification(p,a,b) (p)->lpVtbl->AcquireNotification(a,b)
  234. #define IVideoPortNotify_ReleaseNotification(p,a)   (p)->lpVtbl->ReleaseNotification(a)
  235. #endif
  236.  
  237. #endif
  238.  
  239. /*
  240.  * DDVIDEOPORTCONNECT
  241.  */
  242. typedef struct _DDVIDEOPORTCONNECT
  243. {
  244.     DWORD dwSize;           // size of the DDVIDEOPORTCONNECT structure
  245.     DWORD dwPortWidth;      // Width of the video port
  246.     GUID  guidTypeID;       // Description of video port connection
  247.     DWORD dwFlags;          // Connection flags
  248.     ULONG_PTR dwReserved1;      // Reserved, set to zero.
  249. } DDVIDEOPORTCONNECT;
  250.  
  251.  
  252. /*
  253.  * DDVIDEOPORTCAPS
  254.  */
  255. typedef struct _DDVIDEOPORTCAPS
  256. {
  257.     DWORD dwSize;            // size of the DDVIDEOPORTCAPS structure
  258.     DWORD dwFlags;            // indicates which fields contain data
  259.     DWORD dwMaxWidth;            // max width of the video port field
  260.     DWORD dwMaxVBIWidth;        // max width of the VBI data
  261.     DWORD dwMaxHeight;             // max height of the video port field
  262.     DWORD dwVideoPortID;        // Video port ID (0 - (dwMaxVideoPorts -1))
  263.     DWORD dwCaps;            // Video port capabilities
  264.     DWORD dwFX;                // More video port capabilities
  265.     DWORD dwNumAutoFlipSurfaces;    // Max number of autoflippable surfaces allowed
  266.     DWORD dwAlignVideoPortBoundary;    // Byte restriction of placement within the surface
  267.     DWORD dwAlignVideoPortPrescaleWidth;// Byte restriction of width after prescaling
  268.     DWORD dwAlignVideoPortCropBoundary;    // Byte restriction of left cropping
  269.     DWORD dwAlignVideoPortCropWidth;    // Byte restriction of cropping width
  270.     DWORD dwPreshrinkXStep;        // Width can be shrunk in steps of 1/x
  271.     DWORD dwPreshrinkYStep;        // Height can be shrunk in steps of 1/x
  272.     DWORD dwNumVBIAutoFlipSurfaces;    // Max number of VBI autoflippable surfaces allowed
  273.     DWORD dwNumPreferredAutoflip;    // Optimal number of autoflippable surfaces for hardware
  274.     WORD  wNumFilterTapsX;              // Number of taps the prescaler uses in the X direction (0 - no prescale, 1 - replication, etc.)
  275.     WORD  wNumFilterTapsY;              // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.)
  276. } DDVIDEOPORTCAPS;
  277.  
  278. /*
  279.  * The dwMaxWidth and dwMaxVBIWidth members are valid
  280.  */
  281. #define DDVPD_WIDTH        0x00000001l
  282.  
  283. /*
  284.  * The dwMaxHeight member is valid
  285.  */
  286. #define DDVPD_HEIGHT        0x00000002l
  287.  
  288. /*
  289.  * The dwVideoPortID member is valid
  290.  */
  291. #define DDVPD_ID        0x00000004l
  292.  
  293. /*
  294.  * The dwCaps member is valid
  295.  */
  296. #define DDVPD_CAPS        0x00000008l
  297.  
  298. /*
  299.  * The dwFX member is valid
  300.  */
  301. #define DDVPD_FX        0x00000010l
  302.  
  303. /*
  304.  * The dwNumAutoFlipSurfaces member is valid
  305.  */
  306. #define DDVPD_AUTOFLIP        0x00000020l
  307.  
  308. /*
  309.  * All of the alignment members are valid
  310.  */
  311. #define DDVPD_ALIGN        0x00000040l
  312.  
  313. /*
  314.  * The dwNumPreferredAutoflip member is valid
  315.  */
  316. #define DDVPD_PREFERREDAUTOFLIP 0x00000080l
  317.  
  318. /*
  319.  * The wNumFilterTapsX and wNumFilterTapsY fields are valid
  320.  */
  321. #define DDVPD_FILTERQUALITY     0x00000100l
  322.  
  323. /*
  324.  * DDVIDEOPORTDESC
  325.  */
  326. typedef struct _DDVIDEOPORTDESC
  327. {
  328.     DWORD dwSize;            // size of the DDVIDEOPORTDESC structure
  329.     DWORD dwFieldWidth;            // width of the video port field
  330.     DWORD dwVBIWidth;            // width of the VBI data
  331.     DWORD dwFieldHeight;        // height of the video port field
  332.     DWORD dwMicrosecondsPerField;    // Microseconds per video field
  333.     DWORD dwMaxPixelsPerSecond;        // Maximum pixel rate per second
  334.     DWORD dwVideoPortID;        // Video port ID (0 - (dwMaxVideoPorts -1))
  335.     DWORD dwReserved1;            // Reserved for future use - set to zero (struct padding)
  336.     DDVIDEOPORTCONNECT VideoPortType;     // Description of video port connection
  337.     ULONG_PTR dwReserved2;        // Reserved for future use - set to zero
  338.     ULONG_PTR dwReserved3;        // Reserved for future use - set to zero
  339. } DDVIDEOPORTDESC;
  340.  
  341.  
  342. /*
  343.  * DDVIDEOPORTINFO
  344.  */
  345. typedef struct _DDVIDEOPORTINFO
  346. {
  347.     DWORD dwSize;            // Size of the structure
  348.     DWORD dwOriginX;            // Placement of the video data within the surface.
  349.     DWORD dwOriginY;            // Placement of the video data within the surface.
  350.     DWORD dwVPFlags;            // Video port options
  351.     RECT rCrop;                // Cropping rectangle (optional).
  352.     DWORD dwPrescaleWidth;        // Determines pre-scaling/zooming in the X direction (optional).
  353.     DWORD dwPrescaleHeight;        // Determines pre-scaling/zooming in the Y direction (optional).
  354.     LPDDPIXELFORMAT lpddpfInputFormat;    // Video format written to the video port
  355.     LPDDPIXELFORMAT lpddpfVBIInputFormat; // Input format of the VBI data
  356.     LPDDPIXELFORMAT lpddpfVBIOutputFormat;// Output format of the data
  357.     DWORD dwVBIHeight;            // Specifies the number of lines of data within the vertical blanking interval.
  358.     ULONG_PTR dwReserved1;        // Reserved for future use - set to zero
  359.     ULONG_PTR dwReserved2;        // Reserved for future use - set to zero
  360. } DDVIDEOPORTINFO;
  361.  
  362.  
  363. /*
  364.  * DDVIDEOPORTBANDWIDTH
  365.  */
  366. typedef struct _DDVIDEOPORTBANDWIDTH
  367. {
  368.     DWORD dwSize;            // Size of the structure
  369.     DWORD dwCaps;
  370.     DWORD dwOverlay;                   // Zoom factor at which overlay is supported
  371.     DWORD dwColorkey;            // Zoom factor at which overlay w/ colorkey is supported
  372.     DWORD dwYInterpolate;        // Zoom factor at which overlay w/ Y interpolation is supported
  373.     DWORD dwYInterpAndColorkey;        // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
  374.     ULONG_PTR dwReserved1;        // Reserved for future use - set to zero
  375.     ULONG_PTR dwReserved2;        // Reserved for future use - set to zero
  376. } DDVIDEOPORTBANDWIDTH;
  377.  
  378.  
  379. /*
  380.  * DDVIDEOPORTSTATUS
  381.  */
  382. typedef struct _DDVIDEOPORTSTATUS
  383. {
  384.     DWORD dwSize;            // Size of the structure
  385.     BOOL  bInUse;            // TRUE if video port is currently being used
  386.     DWORD dwFlags;                   // Currently not used
  387.     DWORD dwReserved1;            // Reserved for future use
  388.     DDVIDEOPORTCONNECT VideoPortType;    // Information about the connection
  389.     ULONG_PTR dwReserved2;        // Reserved for future use
  390.     ULONG_PTR dwReserved3;        // Reserved for future use
  391. } DDVIDEOPORTSTATUS;
  392.  
  393. /*
  394.  * DDVIDEOPORTNOTIFY
  395.  */
  396. typedef struct _DDVIDEOPORTNOTIFY
  397. {
  398.     LARGE_INTEGER ApproximateTimeStamp;    // Timestamp in the event notification
  399.     LONG lField;                        // 0 if even, 1 if odd, -1 if unknown
  400.     UINT dwSurfaceIndex;                // Index in the surface chain of the surface that received the sample
  401.     LONG lDone;                         // Call InterlockedIncrement on this when done with sample
  402. } DDVIDEOPORTNOTIFY;
  403.  
  404.  
  405. /*============================================================================
  406.  *
  407.  * Video Port Flags
  408.  *
  409.  * All flags are bit flags.
  410.  *
  411.  *==========================================================================*/
  412.  
  413. /****************************************************************************
  414.  *
  415.  * VIDEOPORT DDVIDEOPORTCONNECT FLAGS
  416.  *
  417.  ****************************************************************************/
  418.  
  419. /*
  420.  * When this is set by the driver and passed to the client, this
  421.  * indicates that the video port is capable of double clocking the data.
  422.  * When this is set by the client, this indicates that the video port
  423.  * should enable double clocking.  This flag is only valid with external
  424.  * syncs.
  425.  */
  426. #define DDVPCONNECT_DOUBLECLOCK            0x00000001l
  427.  
  428. /*
  429.  * When this is set by the driver and passed to the client, this
  430.  * indicates that the video port is capable of using an external VACT
  431.  * signal. When this is set by the client, this indicates that the
  432.  * video port should use the external VACT signal.
  433.  */
  434. #define DDVPCONNECT_VACT            0x00000002l
  435.  
  436. /*
  437.  * When this is set by the driver and passed to the client, this
  438.  * indicates that the video port is capable of treating even fields
  439.  * like odd fields and visa versa.  When this is set by the client,
  440.  * this indicates that the video port should treat even fields like odd
  441.  * fields.
  442.  */
  443. #define DDVPCONNECT_INVERTPOLARITY        0x00000004l
  444.  
  445. /*
  446.  * Indicates that any data written to the video port during the VREF
  447.  * period will not be written into the frame buffer. This flag is read only.
  448.  */
  449. #define DDVPCONNECT_DISCARDSVREFDATA        0x00000008l
  450.  
  451. /*
  452.  * When this is set be the driver and passed to the client, this
  453.  * indicates that the device will write half lines into the frame buffer
  454.  * if half lines are provided by the decoder.  If this is set by the client,
  455.  * this indicates that the decoder will be supplying half lines.
  456.  */
  457. #define DDVPCONNECT_HALFLINE            0x00000010l
  458.  
  459. /*
  460.  * Indicates that the signal is interlaced. This flag is only
  461.  * set by the client.
  462.  */
  463. #define DDVPCONNECT_INTERLACED            0x00000020l
  464.  
  465. /*
  466.  * Indicates that video port is shareable and that this video port
  467.  * will use the even fields.  This flag is only set by the client.
  468.  */
  469. #define DDVPCONNECT_SHAREEVEN            0x00000040l
  470.  
  471. /*
  472.  * Indicates that video port is shareable and that this video port
  473.  * will use the odd fields.  This flag is only set by the client.
  474.  */
  475. #define DDVPCONNECT_SHAREODD            0x00000080l
  476.  
  477. /****************************************************************************
  478.  *
  479.  * VIDEOPORT DDVIDEOPORTDESC CAPS
  480.  *
  481.  ****************************************************************************/
  482.  
  483. /*
  484.  * Flip can be performed automatically to avoid tearing.
  485.  */
  486. #define DDVPCAPS_AUTOFLIP            0x00000001l
  487.  
  488. /*
  489.  * Supports interlaced video
  490.  */
  491. #define DDVPCAPS_INTERLACED            0x00000002l
  492.  
  493. /*
  494.  * Supports non-interlaced video
  495.  */
  496. #define DDVPCAPS_NONINTERLACED            0x00000004l
  497.  
  498. /*
  499.  * Indicates that the device can return whether the current field
  500.  * of an interlaced signal is even or odd.
  501.  */
  502. #define DDVPCAPS_READBACKFIELD            0x00000008l
  503.  
  504. /*
  505.  * Indicates that the device can return the current line of video
  506.  * being written into the frame buffer.
  507.  */
  508. #define DDVPCAPS_READBACKLINE            0x00000010l
  509.  
  510. /*
  511.  * Allows two gen-locked video streams to share a single video port,
  512.  * where one stream uses the even fields and the other uses the odd
  513.  * fields. Separate parameters (including address, scaling,
  514.  * cropping, etc.) are maintained for both fields.)
  515.  */
  516. #define DDVPCAPS_SHAREABLE            0x00000020l
  517.  
  518. /*
  519.  * Even fields of video can be automatically discarded.
  520.  */
  521. #define DDVPCAPS_SKIPEVENFIELDS            0x00000040l
  522.  
  523. /*
  524.  * Odd fields of video can be automatically discarded.
  525.  */
  526. #define DDVPCAPS_SKIPODDFIELDS            0x00000080l
  527.  
  528. /*
  529.  * Indicates that the device is capable of driving the graphics
  530.  * VSYNC with the video port VSYNC.
  531.  */
  532. #define DDVPCAPS_SYNCMASTER            0x00000100l
  533.  
  534. /*
  535.  * Indicates that data within the vertical blanking interval can
  536.  * be written to a different surface.
  537.  */
  538. #define DDVPCAPS_VBISURFACE            0x00000200l
  539.  
  540. /*
  541.  * Indicates that the video port can perform color operations
  542.  * on the incoming data before it is written to the frame buffer.
  543.  */
  544. #define DDVPCAPS_COLORCONTROL            0x00000400l
  545.  
  546. /*
  547.  * Indicates that the video port can accept VBI data in a different
  548.  * width or format than the regular video data.
  549.  */
  550. #define DDVPCAPS_OVERSAMPLEDVBI            0x00000800l
  551.  
  552. /*
  553.  * Indicates that the video port can write data directly to system memory
  554.  */
  555. #define DDVPCAPS_SYSTEMMEMORY            0x00001000l
  556.  
  557. /*
  558.  * Indicates that the VBI and video portions of the video stream can
  559.  * be controlled by an independent processes.
  560.  */
  561. #define DDVPCAPS_VBIANDVIDEOINDEPENDENT        0x00002000l
  562.  
  563. /*
  564.  * Indicates that the video port contains high quality hardware
  565.  * de-interlacing hardware that should be used instead of the
  566.  * bob/weave algorithms.
  567.  */
  568. #define DDVPCAPS_HARDWAREDEINTERLACE        0x00004000l
  569.  
  570.  
  571. /****************************************************************************
  572.  *
  573.  * VIDEOPORT DDVIDEOPORTDESC FX
  574.  *
  575.  ****************************************************************************/
  576.  
  577. /*
  578.  * Limited cropping is available to crop out the vertical interval data.
  579.  */
  580. #define DDVPFX_CROPTOPDATA            0x00000001l
  581.  
  582. /*
  583.  * Incoming data can be cropped in the X direction before it is written
  584.  * to the surface.
  585.  */
  586. #define DDVPFX_CROPX                0x00000002l
  587.  
  588. /*
  589.  * Incoming data can be cropped in the Y direction before it is written
  590.  * to the surface.
  591.  */
  592. #define DDVPFX_CROPY                0x00000004l
  593.  
  594. /*
  595.  * Supports interleaving interlaced fields in memory.
  596.  */
  597. #define DDVPFX_INTERLEAVE            0x00000008l
  598.  
  599. /*
  600.  * Supports mirroring left to right as the video data is written
  601.  * into the frame buffer.
  602.  */
  603. #define DDVPFX_MIRRORLEFTRIGHT            0x00000010l
  604.  
  605. /*
  606.  * Supports mirroring top to bottom as the video data is written
  607.  * into the frame buffer.
  608.  */
  609. #define DDVPFX_MIRRORUPDOWN            0x00000020l
  610.  
  611. /*
  612.  * Data can be arbitrarily shrunk in the X direction before it
  613.  * is written to the surface.
  614.  */
  615. #define DDVPFX_PRESHRINKX            0x00000040l
  616.  
  617. /*
  618.  * Data can be arbitrarily shrunk in the Y direction before it
  619.  * is written to the surface.
  620.  */
  621. #define DDVPFX_PRESHRINKY            0x00000080l
  622.  
  623. /*
  624.  * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
  625.  * direction before it is written to the surface.
  626.  */
  627. #define DDVPFX_PRESHRINKXB            0x00000100l
  628.  
  629. /*
  630.  * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
  631.  * direction before it is written to the surface.
  632.  */
  633. #define DDVPFX_PRESHRINKYB            0x00000200l
  634.  
  635. /*
  636.  * Data can be shrunk in increments of 1/x in the X direction
  637.  * (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkXStep)
  638.  * before it is written to the surface.
  639.  */
  640. #define DDVPFX_PRESHRINKXS            0x00000400l
  641.  
  642. /*
  643.  * Data can be shrunk in increments of 1/x in the Y direction
  644.  * (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkYStep)
  645.  * before it is written to the surface.
  646.  */
  647. #define DDVPFX_PRESHRINKYS            0x00000800l
  648.  
  649. /*
  650.  * Data can be arbitrarily stretched in the X direction before
  651.  * it is written to the surface.
  652.  */
  653. #define DDVPFX_PRESTRETCHX            0x00001000l
  654.  
  655. /*
  656.  * Data can be arbitrarily stretched in the Y direction before
  657.  * it is written to the surface.
  658.  */
  659. #define DDVPFX_PRESTRETCHY            0x00002000l
  660.  
  661. /*
  662.  * Data can be integer stretched in the X direction before it is
  663.  * written to the surface.
  664.  */
  665. #define DDVPFX_PRESTRETCHXN            0x00004000l
  666.  
  667. /*
  668.  * Data can be integer stretched in the Y direction before it is
  669.  * written to the surface.
  670.  */
  671. #define DDVPFX_PRESTRETCHYN            0x00008000l
  672.  
  673. /*
  674.  * Indicates that data within the vertical blanking interval can
  675.  * be converted independently of the remaining video data.
  676.  */
  677. #define DDVPFX_VBICONVERT            0x00010000l
  678.  
  679. /*
  680.  * Indicates that scaling can be disabled for data within the
  681.  * vertical blanking interval.
  682.  */
  683. #define DDVPFX_VBINOSCALE            0x00020000l
  684.  
  685. /*
  686.  * Indicates that the video data can ignore the left and right
  687.  * cropping coordinates when cropping oversampled VBI data.
  688.  */
  689. #define DDVPFX_IGNOREVBIXCROP            0x00040000l
  690.  
  691. /*
  692.  * Indicates that interleaving can be disabled for data within the
  693.  * vertical blanking interval.
  694.  */
  695. #define DDVPFX_VBINOINTERLEAVE            0x00080000l
  696.  
  697.  
  698. /****************************************************************************
  699.  *
  700.  * VIDEOPORT DDVIDEOPORTINFO FLAGS
  701.  *
  702.  ****************************************************************************/
  703.  
  704. /*
  705.  * Perform automatic flipping.   Auto-flipping is performed between
  706.  * the overlay surface that was attached to the video port using
  707.  * IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
  708.  * are attached to the surface via the IDirectDrawSurface::AttachSurface
  709.  * method.  The flip order is the order in which the overlay surfaces
  710.  * were. attached.
  711.  */
  712. #define DDVP_AUTOFLIP                0x00000001l
  713.  
  714. /*
  715.  * Perform conversion using the ddpfOutputFormat information.
  716.  */
  717. #define DDVP_CONVERT                0x00000002l
  718.  
  719. /*
  720.  * Perform cropping using the specified rectangle.
  721.  */
  722. #define DDVP_CROP                0x00000004l
  723.  
  724. /*
  725.  * Indicates that interlaced fields should be interleaved in memory.
  726.  */
  727. #define DDVP_INTERLEAVE                0x00000008l
  728.  
  729. /*
  730.  * Indicates that the data should be mirrored left to right as it's
  731.  * written into the frame buffer.
  732.  */
  733. #define DDVP_MIRRORLEFTRIGHT            0x00000010l
  734.  
  735. /*
  736.  * Indicates that the data should be mirrored top to bottom as it's
  737.  * written into the frame buffer.
  738.  */
  739. #define DDVP_MIRRORUPDOWN            0x00000020l
  740.  
  741. /*
  742.  * Perform pre-scaling/zooming based on the pre-scale parameters.
  743.  */
  744. #define DDVP_PRESCALE                0x00000040l
  745.  
  746. /*
  747.  * Ignore input of even fields.
  748.  */
  749. #define DDVP_SKIPEVENFIELDS            0x00000080l
  750.  
  751. /*
  752.  * Ignore input of odd fields.
  753.  */
  754. #define DDVP_SKIPODDFIELDS            0x00000100l
  755.  
  756. /*
  757.  * Drive the graphics VSYNCs using the video port VYSNCs.
  758.  */
  759. #define DDVP_SYNCMASTER                0x00000200l
  760.  
  761. /*
  762.  * The ddpfVBIOutputFormatFormat member contains data that should be used
  763.  * to convert the data within the vertical blanking interval.
  764.  */
  765. #define DDVP_VBICONVERT                0x00000400l
  766.  
  767. /*
  768.  * Indicates that data within the vertical blanking interval
  769.  * should not be scaled.
  770.  */
  771. #define DDVP_VBINOSCALE                0x00000800l
  772.  
  773. /*
  774.  * Indicates that these bob/weave decisions should not be
  775.  * overriden by other interfaces.
  776.  */
  777. #define DDVP_OVERRIDEBOBWEAVE            0x00001000l
  778.  
  779. /*
  780.  * Indicates that the video data should ignore the left and right
  781.  * cropping coordinates when cropping the VBI data.
  782.  */
  783. #define DDVP_IGNOREVBIXCROP            0x00002000l
  784.  
  785. /*
  786.  * Indicates that interleaving can be disabled for data within the
  787.  * vertical blanking interval.
  788.  */
  789. #define DDVP_VBINOINTERLEAVE            0x00004000l
  790.  
  791. /*
  792.  * Indicates that the video port should use the hardware
  793.  * de-interlacing hardware.
  794.  */
  795. #define DDVP_HARDWAREDEINTERLACE        0x00008000l
  796.  
  797. /****************************************************************************
  798.  *
  799.  * DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
  800.  *
  801.  ****************************************************************************/
  802.  
  803. /*
  804.  * Return formats for the video data
  805.  */
  806. #define DDVPFORMAT_VIDEO            0x00000001l
  807.  
  808. /*
  809.  * Return formats for the VBI data
  810.  */
  811. #define DDVPFORMAT_VBI                0x00000002l
  812.  
  813. /****************************************************************************
  814.  *
  815.  * DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
  816.  *
  817.  ****************************************************************************/
  818.  
  819. /*
  820.  * Surface should receive video data (and VBI data if a surface
  821.  * is not explicitly attached for that purpose)
  822.  */
  823. #define DDVPTARGET_VIDEO            0x00000001l
  824.  
  825. /*
  826.  * Surface should receive VBI data
  827.  */
  828. #define DDVPTARGET_VBI                0x00000002l
  829.  
  830.  
  831. /****************************************************************************
  832.  *
  833.  * DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
  834.  *
  835.  ****************************************************************************/
  836.  
  837. /*
  838.  * Waits until the beginning of the next VSYNC
  839.  */
  840. #define DDVPWAIT_BEGIN                0x00000001l
  841.  
  842. /*
  843.  * Waits until the end of the next/current VSYNC
  844.  */
  845. #define DDVPWAIT_END                0x00000002l
  846.  
  847. /*
  848.  * Waits until the beginning of the specified line
  849.  */
  850. #define DDVPWAIT_LINE                0x00000003l
  851.  
  852. /****************************************************************************
  853.  *
  854.  * DIRECTDRAWVIDEOPORT FLIP FLAGS
  855.  *
  856.  ****************************************************************************/
  857.  
  858. /*
  859.  * Flips the normal video surface
  860.  */
  861. #define DDVPFLIP_VIDEO                0x00000001l
  862.  
  863. /*
  864.  * Flips the VBI surface
  865.  */
  866. #define DDVPFLIP_VBI                0x00000002l
  867.  
  868. /****************************************************************************
  869.  *
  870.  * DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
  871.  *
  872.  ****************************************************************************/
  873.  
  874. /*
  875.  * No video signal is present at the video port
  876.  */
  877. #define DDVPSQ_NOSIGNAL                0x00000001l
  878.  
  879. /*
  880.  * A valid video signal is present at the video port
  881.  */
  882. #define DDVPSQ_SIGNALOK                0x00000002l
  883.  
  884. /****************************************************************************
  885.  *
  886.  * VIDEOPORTBANDWIDTH Flags
  887.  *
  888.  ****************************************************************************/
  889.  
  890. /*
  891.  * The specified height/width refer to the size of the video port data
  892.  * written into memory, after prescaling has occured.
  893.  */
  894. #define DDVPB_VIDEOPORT                0x00000001l
  895.  
  896. /*
  897.  * The specified height/width refer to the source size of the overlay.
  898.  */
  899. #define DDVPB_OVERLAY                0x00000002l
  900.  
  901. /*
  902.  * This is a query for the device to return which caps this device requires.
  903.  */
  904. #define DDVPB_TYPE                0x00000004l
  905.  
  906. /****************************************************************************
  907.  *
  908.  * VIDEOPORTBANDWIDTH Caps
  909.  *
  910.  ****************************************************************************/
  911.  
  912. /*
  913.  * The bandwidth for this device is dependant on the overlay source size.
  914.  */
  915. #define DDVPBCAPS_SOURCE            0x00000001l
  916.  
  917. /*
  918.  * The bandwidth for this device is dependant on the overlay destination
  919.  * size.
  920.  */
  921. #define DDVPBCAPS_DESTINATION            0x00000002l
  922.  
  923. /****************************************************************************
  924.  *
  925.  * DDVIDEOPORTCONTAINER CreateVideoPort flags
  926.  *
  927.  ****************************************************************************/
  928.  
  929. /*
  930.  * The process only wants to control the VBI portion of the video stream.
  931.  */
  932. #define DDVPCREATE_VBIONLY            0x00000001l
  933.  
  934. /*
  935.  * The process only wants to control the non-VBI (video) portion of
  936.  * the video stream.
  937.  */
  938. #define DDVPCREATE_VIDEOONLY            0x00000002l
  939.  
  940. /****************************************************************************
  941.  *
  942.  * DDVIDEOPORTSTATUS flags
  943.  *
  944.  ****************************************************************************/
  945.  
  946. /*
  947.  * The video port interface is only controlling the VBI portion of the
  948.  * video stream
  949.  */
  950. #define DDVPSTATUS_VBIONLY            0x00000001l
  951.  
  952. /*
  953.  * The video port interface is only controlling the video portion of the
  954.  * video stream
  955.  */
  956. #define DDVPSTATUS_VIDEOONLY            0x00000002l
  957.  
  958.  
  959. #ifdef __cplusplus
  960. };
  961. #endif
  962.  
  963. #endif  // GUID_DEFS_ONLY
  964.  
  965. #endif
  966.  
  967.